import request from '@/utils/request.js'
export default{
	// 分页的分类数据
	getAllCategories(currentPage,pageSize){
		return request({
			url:`/category/getCategory/${currentPage}/${pageSize}`,
			method:"GET"
		})
	},
	// 不带分页的全部分页数据
	getAllCategory(){
		return request({
			url:`/category/getAllCategory`,
			method:"GET"
		})
	},

	
	delCategoryById(id){
		return request({
			url:`/category/delCategoryById/${id}`,
			method:"GET"
		})
	},
	getCategoryById(id){
		return request({
			url:`/category/getCategoryById/${id}`,
			method:"GET"
		})
	},
	updateByCid(category){
		return request({
			url:`/category/updateByCid`,
			method:"POST",
			data:category
		})
	},
	addCategory(categoryVo){
		return request({
			url:`/category/addOrUpdateCategory`,
			method:"POST",
			data:categoryVo
		})
	},
	// 根据name查询
	searchArticleByName(name,currentPage,pageSize){
	    return request({
	      url:`/category/searchByName/${name}/${currentPage}/${pageSize}`,
	      method:"GET"
	    })
	  }
}